﻿

#region Using Statements

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Xml;
using System.Xml.Serialization;
using System.Threading;
using System.ComponentModel;
using System.Reflection;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Design;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

using Freeform;
using FGame = Freeform.Game;
using XGame = Microsoft.Xna.Framework.Game;

#endregion


namespace Freeform
{
    /// <summary>
    /// A structure that represents that current state of a KeyBinding.
    /// </summary>
    public class KeyBinding
    {

        #region Members

        /// <summary>
        /// The key assigned to this bind.
        /// </summary>
        public Keys Key { get; set; }


        /// <summary>
        /// The name of the key binding.
        /// </summary>
        public String Name { get; set; }


        /// <summary>
        /// The current KeyState of the bind.
        /// </summary>
        public KeyState State { get; set; }

        #endregion


        #region Init

        /// <summary>
        /// Creates a new KeyBinding.
        /// </summary>
        /// <param name="Name">The name of the bind.</param>
        /// <param name="Key">The key assigned to the bind.</param>
        public KeyBinding(String Name, Keys Key)
        {
            this.Name = Name;
            this.Key = Key;
            this.State = Keyboard.GetState().IsKeyDown(Key) ? KeyState.Down : KeyState.Up;
        }

        #endregion

    }
}